Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: refactor to use validateObject #37028

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

Lxxyx
Copy link
Member

@Lxxyx Lxxyx commented Jan 23, 2021

No description provided.

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Jan 23, 2021
Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These require(…) calls should probably all be multiline:

lib/internal/process/per_thread.js Outdated Show resolved Hide resolved
lib/path.js Outdated Show resolved Hide resolved
lib/internal/assert/assertion_error.js Outdated Show resolved Hide resolved
lib/internal/streams/end-of-stream.js Outdated Show resolved Hide resolved
lib/internal/util/inspect.js Outdated Show resolved Hide resolved
lib/repl.js Outdated Show resolved Hide resolved
lib/trace_events.js Outdated Show resolved Hide resolved
lib/perf_hooks.js Outdated Show resolved Hide resolved
lib/internal/url.js Outdated Show resolved Hide resolved
lib/internal/streams/end-of-stream.js Outdated Show resolved Hide resolved
@Trott
Copy link
Member

Trott commented Jan 23, 2021

Most of these represent a change in behavior where an array was previously permitted but now it is not. I don't think that's a problem, but pointing it out in case others think we should be cautious about that and maybe rate this as semver-major.

Trott added a commit to Trott/io.js that referenced this pull request Jan 23, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: nodejs#37028 (review)
@Lxxyx Lxxyx force-pushed the refactor-to-use-validate-object branch from 5964a61 to d777cbc Compare January 24, 2021 06:54
@ExE-Boss
Copy link
Contributor

@Trott

Most of these represent a change in behavior where an array was previously permitted but now it is not.

I’m adding an allowArray option to validateObject in #37047 to prevent this from being a breaking change (and also to fix the WebIDL‑based APIs).

Trott added a commit to Trott/io.js that referenced this pull request Jan 25, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: nodejs#37028 (review)
Trott added a commit to Trott/io.js that referenced this pull request Jan 25, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: nodejs#37028 (review)
@nodejs-github-bot
Copy link
Collaborator

@Lxxyx Lxxyx added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 26, 2021
Trott added a commit to Trott/io.js that referenced this pull request Jan 27, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: nodejs#37028 (review)

PR-URL: nodejs#37040
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Lxxyx Lxxyx force-pushed the refactor-to-use-validate-object branch from 14eca5f to 3686855 Compare January 28, 2021 05:16
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

PR-URL: nodejs#37028
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95 aduh95 force-pushed the refactor-to-use-validate-object branch from 3686855 to 029d1fd Compare January 28, 2021 11:55
@aduh95
Copy link
Contributor

aduh95 commented Jan 28, 2021

Landed in 029d1fd

@aduh95 aduh95 closed this Jan 28, 2021
@aduh95 aduh95 merged commit 029d1fd into nodejs:master Jan 28, 2021
@Lxxyx Lxxyx deleted the refactor-to-use-validate-object branch January 28, 2021 13:47
(options === null || typeof options !== 'object')) {
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
} else if (options !== undefined) {
validateObject(options, 'options');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this change broke cheerio through the workerpool module: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2604/nodes=fedora-last-latest-x64/testReport/junit/(root)/citgm/cheerio_v1_0_0_rc_5/

See https://github.com/josdejong/workerpool/blob/b0e72695fc26df60e224c2d2eafc402f3097a6f4/src/WorkerHandler.js#L262

It would probably be nice to open a PR to fix that module. It seems to have been working by accident until now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also do #37047.

targos pushed a commit that referenced this pull request Feb 2, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: #37028 (review)

PR-URL: #37040
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this pull request Feb 2, 2021
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

PR-URL: #37028
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Feb 2, 2021
@kanongil
Copy link
Contributor

kanongil commented Mar 3, 2021

The workerpool breakage is more serious than fixing the head version. My project uses both v2 and v3 through various dependencies I have little control over.

@Trott
Copy link
Member

Trott commented Mar 3, 2021

The workerpool breakage is more serious than fixing the head version. My project uses both v2 and v3 through various dependencies I have little control over.

Ooof. The fix is in workerpool@6.1.0, released about one month ago.

Unfortunately, workerpool@6.1.0 accounts for less than 1/3 of the package's over 2.2 million downloads in the last week.

targos pushed a commit that referenced this pull request May 30, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: #37028 (review)

PR-URL: #37040
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: #37028 (review)

PR-URL: #37040
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: #37028 (review)

PR-URL: #37040
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
I saw a PR review comment  about newlines in desructured
assignments, and this would be the rule to enforce these kinds of nits.
Start by just enabling the rule. We can incrementally adjust it to be
more strict.

Refs: https://eslint.org/docs/rules/object-curly-newline
Refs: #37028 (review)

PR-URL: #37040
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants